﻿@using DevelopmentKit.Cms.Domain
@using DevelopmentKit.Extensions.MvcContrib
@model IEnumerable<Content>
@{
    Layout = null; 
} 
<ul class="jqueryFileTree">
    @foreach (var item in Model)
    {
        var current = item;
        var htmlString = string.Empty; 
        while (null != current)
        {
            if (current == item)
            {
                htmlString = current.Title;
            }
            else
            {
                htmlString =  current.Title  + "»" + htmlString;
            }
            current = current.Parent;
        }
        
        var list = item.Children.Where(x => x.Definition.IsNode);
        <li class="directory collapsed">
            <span> @Html.ActionLinkEx(item.Title, "Details", "ContentManger", new {id = item.Id}, new {@class = "treename",target= "MainFrame",nav=htmlString}) 
            </span> 
            @if (list.Any())
            {
                @Html.Partial("Node", list)
            }  
        </li>
    }
</ul> 
 